package com.liao.rent.controller;

import com.liao.rent.entity.JsonResult;
import com.liao.rent.service.SysRoleService;
import com.liao.rent.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户角色表 前端控制器
 * </p>
 *
 * @author liao
 * @since 2024-11-24
 */
@RestController
@RequestMapping("/sysRole")
public class SysRoleController {

    @Autowired
private SysRoleService sysRoleService;

    /**
     * 查询所有角色
     * @return
     */
    @PreAuthorize("hasAuthority('admin')")
    @RequestMapping("/list")
    public JsonResult list(){
        sysRoleService.list();

        return ResultTool.success(sysRoleService.list());
    }



}
